<!DOCTYPE html>
<html>
<head>
<title>{$site_name}</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link href="__TMPL__Public/assets/css/header.css" rel="stylesheet" type="text/css">
    <link href="__TMPL__Public/assets/css/member.css" type="text/css" rel="stylesheet">
    <link href="__TMPL__Public/assets/css/member2.css" rel="stylesheet" type="text/css">
    <link href="__TMPL__Public/assets/css/border2.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__TMPL__Public/assets/js/jquery-1.6.1.min.js"></script>
    <link href="__TMPL__Public/assets/css/jquery-ui-1.8.13.custom.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__TMPL__Public/assets/js/jquery-ui-1.8.13.custom.min.js"></script>
    <style>
        .member .memberbox .memberL .l-title h3 a{
            _background:none;
            filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/template/ydtCopy/module/member/statics/images/back.png', sizingMethod='crop');
        }
    </style>
</head>

<body class="body-white">
<script type="text/javascript">
    var goToUrl = function(url){
        setTimeout(function(){window.location.href=url},1)
    };
    var Top_Path = {webRoot:"",topParam:"member"};

</script>
	<tc_include file="Public:nav" />


    <!--会员中心-->
    <div id="member" class="member">

        <!--所在位置-->
        <tc_include file="Public:position" />
        <!--end 所在位置-->

        <!--会员中心首页-->
        <div class="memberbox">
            <!--会员中心左边-->
            <tc_include file="Public:menu_left" />
            <!--end 会员中心左边-->

            <!--会员中心右边-->
        </div>
        <div class="rArea">
            <div class="medicine">
                <div class="title">留言投诉</div>
                <div class="box" style="padding-left:14px;">
                    <div class="lBox">
                        <div class="t_Menu">
                            <ul>
                                <li><a class="cur" href="{:U('product/member/complaint')}">我的留言</a></li>
                                <li><a href="{:U('product/member/complaint_2')}">我的建议</a></li>
                                <li><a href="{:U('product/member/complaint_3')}">我的投诉</a></li>
                            </ul>
                        </div>
                        <script>


                            function sendComment(){
                                var commentCont = $("#commentCont").val();
                                commentCont=commentCont.replace(/<(script|link|style|iframe)(.|\n)*\/\1>\s*/ig,"");
                                commentCont=commentCont.replace(/<.*?>/g,"");

                                if(commentCont.length > 255 || commentCont.length < 5){
                                    alertMessage("<div style='font-weight:bold;margin-top:20px;'>长度在5-255位字符之间！</div>",{
                                        '确定':function(){
                                            $(this).dialog("close");
                                            return false;
                                        }
                                    });

                                    return false;
                                }
                                if(commentCont == "您对网站的留言?我们会及时向您反馈!"){
                                    return false;
                                }
                                // $.ajaxSettings['contentType'] = "application/x-www-form-urlencoded; charset=utf-8";
                                // $.ajax({
                                //     type:"POST",url:location.href,
                                //     data:{messageCont:commentCont},
                                //     dataType:"json",
                                //     success:function(data){
                                //         if (data.success == "true") {
                                //             $("#commentCont").attr("value","您对网站的留言?我们会及时向您反馈!");
                                //             alertMessage("您的留言已发送，我们会及时反馈!",{
                                //                 '确定':function(){
                                //                     window.location.reload();
                                //                 }
                                //             })
                                //         }
                                //     },
                                //     error:function(XMLHttpRequest, textStatus) {
                                //         if (XMLHttpRequest.status == 500) {
                                //             var result = eval("(" + XMLHttpRequest.responseText + ")");
                                //             alertMessage(result.errorObject.errorText);
                                //         }
                                //     }
                                // });
                                $.post(location.href, {content:commentCont}, function(data){
                                    if (data.status) {
                                        $("#commentCont").attr("value","您对网站的留言?我们会及时向您反馈!");
                                        alert("您的留言已发送，我们会及时反馈!");
                                        window.location.reload();
                                    };
                                },'json');
                            }
                            function clearMsgCont(){
                                var cont = $("#commentCont");
                                if(cont.val() == '您对网站的建议?我们会及时向您反馈!'){
                                    cont.attr("value", "");
                                }
                                return false;
                            }
                            function alertMessage(message,buttons){
                                $("#tiptext").html(message);
                                $("#tip").dialog({
                                    buttons:buttons
                                });
                                return false;
                            }
                            function checkMemberName(){
                                var memberName = $("#memberName").val();
                                if(memberName == ""){
                                    $("#memberName").next().html("请输入姓名");
                                    return false;
                                }
                                $("#memberName").next().html("");
                                return true;
                            }
                            function checkMemberTel(){
                                var memberTel = $("#memberTel").val();
                                var regxt = /(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$/
                                if(memberTel == ""){
                                    $("#memberTel").next().html("请输入您的电话号码");
                                    return false;
                                }
                                if(!regxt.test(memberTel)){
                                    $("#memberTel").next().html("请输入正确的电话号码");
                                    return false;
                                }
                                $("#memberTel").next().html("");
                                return true;
                            }

                        </script>
                        <div class="myMedi_ly">
                            <div class="box2" style="border: 0px;">
                                <div class="area1">
                                    <div class="userPic">
                                        <img src="{$avatar}" width="80" height="80">
                                    </div>
                                    <div class="put_Box">
                                        <div class="put"><textarea id="commentCont" onclick="clearMsgCont()" name="" cols="" rows="" placeholder="您对网站的留言?我们会及时向您反馈!"></textarea></div>
                                        <div class="btn"><a href="javascript:;" onclick="sendComment()">发布</a></div>
                                    </div>
                                    <div class="clear"></div>
                                </div>
                                <div class="area2">
                                    <foreach name="list" item="item">
                                    <div class="each">
                                        <div class="l">
                                            <div class="picUser"><a href="javascript;;">
                                                <img src="{$avatar}" width="40px" height="40px">
                                            </a>
                                            </div>
                                        </div>
                                        <div class="r">
                                            <div class="tiText">
                                                <div class="stars"><span>{$user_login}</span> 发表了留言： </div>
                                                <div class="times">{$item.createtime}</div>
                                                <div class="clear"></div>
                                            </div>
                                            <div class="qustion">{$item.content}</div>
                                            <div class="buttomLine"></div>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    </foreach>
                                </div>
                                <div class="page">
                                    <div align="center" style="padding-left:250px ">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </div>
        <!--end 会员中心首页-->
        <div class="clear"></div>
    </div>
    <!--end 会员中心-->

    <tc_include file="Public:member_footer" />

	<tc_include file="Public:footer" />

</body>
</html>